FROM openjdk:8
#COPY target/websocket-demo-0.0.1-SNAPSHOT.jar /usr/src/myapp/websocket-demo-0.0.1-SNAPSHOT.jar
COPY start-service.sh /usr/src/myapp/start-service.sh
WORKDIR /usr/src/myapp/

EXPOSE 8080
# nohup java -jar websocket-demo-0.0.1-SNAPSHOT.jar  > log.file 2>&1 &
# CMD ["nohup", "java", "-jar", "websocket-demo-0.0.1-SNAPSHOT.jar", ">", "/usr/src/myapp/log.file", "2>&1", "&" ]
CMD ["/bin/bash", "/usr/src/myapp/start-service.sh"]

#copy to target cmd
#cp ~/websocket-demo-0.0.1-SNAPSHOT.jar ./target/websocket-demo-0.0.1-SNAPSHOT.jar
#build cmd
#docker build -t af747025114/sgs-zq-backend:2024070801 .
#push cmd
#docker push af747025114/sgs-zq-backend:2024070801
#docker run -p8355:8080 --rm --name=sgs-zq-backend-service af747025114/sgs-zq-backend:2024070801
#docker rm -f sgs-zq-backend-service && docker run -d -p8355:8080 --rm --name=sgs-zq-backend-service af747025114/sgs-zq-backend:2024070801
